#include <iostream>
#include <string>
#include <jsoncpp/json/json.h>
using namespace std;
int main()
{
    //序列化

    Json::Value root;
    root["name"] = "Job";
    root["gender"] = "male";
    string s = root.toStyledString();
    cout << s << endl;

    Json::Value root2;
    root2["name"] = "Job";
    root2["gender"] = "male";
    Json::FastWriter writer;
    string s2 = writer.write(root2);
    cout << s2 << endl;

    Json::Value root3;
    root3["name"] = "Job";
    root3["gender"] = "male";
    Json::StyledWriter swriter;

    string s3 = swriter.write(root3);
    cout << s3 << endl;

    return 0;
}